package com.ssy.lingxi.order.repository;

import com.ssy.lingxi.order.entity.DeliveryPlanDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;

/**
 *  送货计划Jpa仓库
 * @author czh
 * @date 2022/2/21
 * @version 2.0.0
 */
@Repository
public interface DeliveryPlanRepository extends JpaRepository<DeliveryPlanDO, Long>, JpaSpecificationExecutor<DeliveryPlanDO> {

    DeliveryPlanDO findFirstByPlanNo(String planNo);

    DeliveryPlanDO findFirstByBuyerMemberIdAndBuyerRoleIdAndVendorMemberIdAndVendorRoleIdAndPlanStartTimeLessThanEqualAndPlanEndTimeAfter(Long buyerMemberId, Long buyerRoleId, Long vendorMemberId, Long vendorRoleId, LocalDateTime startTime, LocalDateTime endTime);

}

